package com.yanqu.road.server.timer.grandchild;

import com.yanqu.road.server.manager.grandchild.GrandChildMgr;
import com.yanqu.road.utils.date.DateHelper;
import com.yanqu.road.utils.executor.GeneralTask;

public class GrandChildEndExamTask extends GeneralTask {

    private long checkExamFinishTime = 0L;

    @Override
    public void doRun() {

        long now = System.currentTimeMillis();

        // 区服没开导致未结算的科举，让他们结算下
        if (now > checkExamFinishTime + DateHelper.MINUTE_MILLIONS * 3) { // 3分钟一次
            GrandChildMgr.syncToHandleMsg();
            checkExamFinishTime = now;
        }

        // 检查过期科举
        GrandChildMgr.endExpireExam();
    }
}
